package com.qifenqian.turbot.module.contract

import com.qifenqian.turbot.module.entity.request.PhotoRequest
import com.qifenqian.turbot.module.entity.response.UploadEntity
import com.qifenqian.turbot.module.entity.response.restaurant.CuisineEntity
import com.qifenqian.turbot.module.entity.response.restaurant.RestaurantEntity
import com.qifenqian.turbot.module.entity.response.restaurant.RestaurantPhotoEntity
import com.qifenqian.turbot.module.entity.response.restaurant.RestaurantTableEntity
import com.qifenqian.turbot.net.ModelCallback

/**
 * @author H
 * @createTime 2018/12/25 16:05
 * @description
 * @see
 * @since
 */
interface RestaurantContract {

    interface Model {
        /**
         * 获取商铺信息
         */
        fun getRestaurantInfo(showDialog: Boolean, callback: ModelCallback<RestaurantEntity>)

        /**
         * 编辑店铺简称
         */
        fun editShortName(shortName: String, callback: ModelCallback<Nothing>)

        /**
         * 获取餐厅照片
         */
        fun getPhotoList(callback: ModelCallback<List<RestaurantPhotoEntity>>)

        /**
         * 保存餐厅照片
         */
        fun savePhotoList(request: PhotoRequest, callback: ModelCallback<Nothing>)

        /**
         * 获取菜系
         */
        fun getCuisineList(callback: ModelCallback<List<CuisineEntity>>)

        /**
         * 选择菜系
         */
        fun chooseCuisine(cuisine: String, callback: ModelCallback<Nothing>)

        /**
         * 在线选座开关
         */
        fun setAvailableChooseSeat(onlineReservation: Int, callback: ModelCallback<Nothing>)

        /**
         * 修改餐厅电话
         */
        fun changeRestaurantPhone(restaurantPhone: String, callback: ModelCallback<Nothing>)

        /**
         * 更改营业时间
         */
        fun changeBusinessTime(openTime: String, closeTime: String, callback: ModelCallback<Nothing>)

        /**
         * 更改经营地址
         */
        fun changeAddress(province: String, city: String, area: String, address: String, callback: ModelCallback<Nothing>)

        /**
         * 设置人均消费金额
         */
        fun changePersonConsume(consumePerPerson: Int, callback: ModelCallback<Nothing>)

        /**
         * 修改餐厅介绍
         */
        fun changeRestaurantIntroduction(introduction: String, callback: ModelCallback<Nothing>)

        /**
         * 获取餐桌信息
         */
        fun getTableInfo(callback: ModelCallback<RestaurantTableEntity>)

        /**
         * 保存餐桌信息
         */
        fun saveTableInfo(saveTableRequest: RestaurantTableEntity, callback: ModelCallback<Nothing>)

        /**
         * 上传菜品图片
         */
        fun uploadFile(filePaths: MutableList<String>, callback: ModelCallback<UploadEntity>)

        /**
         * 删除餐桌
         */
        fun deleteTableInfo(id: Int, callback: ModelCallback<Nothing>)

    }

    interface View {
        fun getRestaurantInfoResult(isSuccess: Boolean, code: Int = 0, msg: String?, restaurantEntity: RestaurantEntity? = null) {}

        fun editShortNameResult(isSuccess: Boolean, code: Int = 0, msg: String? = null, shortName: String? = null) {}

        fun getPhotoListResult(isSuccess: Boolean, code: Int = 0, msg: String? = null, restaurantPhotoEntities: List<RestaurantPhotoEntity>? = null) {}

        fun savePhotoListResult(isSuccess: Boolean, code: Int = 0, msg: String? = null) {}

        fun getCuisineListResult(isSuccess: Boolean, code: Int = 0, msg: String? = null, cuisineEntities: List<CuisineEntity>? = null) {}

        fun chooseCuisineResult(isSuccess: Boolean, code: Int = 0, msg: String? = null) {}

        fun setAvailableChooseSeatResult(isSuccess: Boolean, msg: String?, isChecked: Boolean = false) {}

        fun changeRestaurantPhoneResult(isSuccess: Boolean, code: Int = 0, msg: String?, phone: String = "") {}

        fun changeBusinessTimeResult(isSuccess: Boolean, code: Int = 0, msg: String?) {}

        fun changeAddressResult(isSuccess: Boolean, code: Int = 0, msg: String?) {}

        fun changePersonConsumeResult(isSuccess: Boolean, code: Int = 0, msg: String?, personConsume: Int = 0) {}

        fun changeRestaurantIntroductionResult(isSuccess: Boolean, code: Int = 0, msg: String?) {}

        fun getTableInfoResult(isSuccess: Boolean, code: Int = 0, msg: String? = null, restaurantTableEntity: RestaurantTableEntity? = null) {}

        fun saveTableInfoResult(isSuccess: Boolean, code: Int = 0, msg: String) {}

        fun uploadFileResult(isSuccess: Boolean, code: Int = 0, msg: String? = null, uploadEntity: UploadEntity? = null) {}

        fun deleteTableInfoResult(isSuccess: Boolean, code: Int = 0, msg: String, position: Int = -1) {}

    }

    interface Presenter {
        fun getRestaurantInfo(showDialog: Boolean)

        fun editShortName(shortName: String)

        fun getPhotoList()

        fun savePhotoList(request: PhotoRequest)

        fun getCuisineList()

        fun chooseCuisine(cuisine: String)

        fun setAvailableChooseSeat(onlineReservation: Int, isChecked: Boolean)

        fun changeRestaurantPhone(restaurantPhone: String)

        fun changeBusinessTime(openTime: String, closeTime: String)

        fun changeAddress(province: String, city: String, area: String, address: String)

        fun changePersonConsume(consumePerPerson: Int)

        fun changeRestaurantIntroduction(introduction: String)

        fun getTableInfo()

        fun saveTableInfo(saveTableRequest: RestaurantTableEntity)

        fun uploadFile(filePaths: MutableList<String>)

        fun deleteTableInfo(id: Int, position: Int)
    }

}
